#define MAX_SIZE 2+3
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<string.h>


//struct _Record_Struct
//{
//	unsigned char Env_Alarm_ID : 4;
//	unsigned char Para1 : 2;
//	unsigned char state;
//	unsigned char avail : 1;
//}*Env_Alarm_Record;
//
//int main()
//{
//	struct _Record_Struct* pointer = (struct _Record_Struct*)malloc(sizeof(struct _Record_Struct) * MAX_SIZE);
//	printf("%zd", sizeof(struct _Record_Struct));
//	return 0;
//}


//int main()
//{
//    union
//    {
//        short k;
//        char i[2];
//    }*s, a;
//    s = &a;
//    s->i[0] = 0x39;
//    s->i[1] = 0x38;
//    printf("%x\n", a.k);
//    return 0;
//}


void* my_memcpy(void* dest, const void* src, size_t num)
{
	void* ret = dest;
	assert(dest);
	assert(src);

	while (num--)
	{
		*(char*)dest = *(char*)src;
		dest = (char*)dest + 1;
		src = (char*)src + 1;
	}

	return ret;
}

int main()
{
	int arr1[] = { 1,2,3,4,5,6,7,8,9,10 };
	int arr2[15] = { 0 };

	//char str1[] = "abcdef";
	//char str2[20] = { 0 };
	
	my_memcpy(arr2, arr1, 24);
	//my_memcpy(str2, str1, 4);
	for (int i = 0; i < 15; i++)
	{
		printf("%d ", arr2[i]);
	}
	return 0;
}

